match-file
Returns true when the given name
matches any of the path properties on a vinyl file
(TOC generated by verb using markdown-toc)
Install
Install with npm:
$ npm i match-file --save
Usage
var matchFile = require('match-file');
var File = require('vinyl');
var file = new File({path: 'a/b/c.txt', base: 'a'});
var isMatch = matchFile('c.txt', file);
Examples
Continuing with the above setup code, each of the following would return true
:
matchFile('a/b/c.txt', file);
matchFile('b/c.txt', file);
matchFile('c.txt', file);
matchFile('c', file);
Related projects
- assemble: Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… more | homepage
- gulp: The streaming build system | homepage
- templates: System for creating and managing template collections, and rendering templates with any node.js template engine.… more | homepage
- verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… more | homepage
- vinyl: A virtual file format | homepage
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Jon Schlinkert
License
Copyright © 2016 Jon Schlinkert
Released under the MIT license.
This file was generated by verb on January 21, 2016.